package com.spring.ioc;

import com.spring.ioc.controller.HelloController;
import com.spring.ioc.service.UserService;
import lombok.val;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@SpringBootApplication
public class SpringIocDemoApplication {

	public static void main(String[] args) {
		ApplicationContext context = SpringApplication.run(SpringIocDemoApplication.class, args);
//
//		HelloController bean1 = context.getBean(HelloController.class);
//		bean1.print();
//
//		HelloController bean2 = (HelloController) context.getBean("helloController");
//		bean2.print();
//
//		HelloController bean3 = context.getBean("helloController",HelloController.class);
//		bean3.print();
//
//		System.out.println(bean1);
//		System.out.println(bean2);
//		System.out.println(bean3);

//		HelloController helloController = context.getBean(HelloController.class);
//		helloController.print();
//		UserService userService = context.getBean(UserService.class);
//		userService.print();
	}

}
